package com.juyu.miliao.api.dao.mysql;

import com.juyu.miliao.api.domain.VipPay;
import org.apache.ibatis.session.SqlSession;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Repository
public class VipPayDao {
    @Resource
    private SqlSession sqlSession;

    public void insertVipPay(VipPay vipPay) {
        sqlSession.insert("insertVipPay", vipPay);
    }


    public List<VipPay> getVipPayByUserId(long userId,long hostUserId,int type) {
        Map<String, Object> map = new HashMap<>(8);
        map.put("userId", userId);
        map.put("hostUserId", hostUserId);
        map.put("type", type);
        return sqlSession.selectList("getVipPayByUserId", map);
    }
}
